/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 *
 * openGauss is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 * http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITFOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 * -------------------------------------------------------------------------
 *
 * ErrorCodeMessage.java
 *
 * IDENTIFICATION
 * plugins/container-management-plugin/src/main/java/org/opengauss/admin/container/config/ErrorCodeMessage.java
 *
 * -------------------------------------------------------------------------
 */

package org.opengauss.admin.container.config;

/**
 * 错误码枚举
 *
 * @since 2024-08-29
 */
public enum ErrorCodeMessage {
    OPERATE_FAILED_RETRY_LATER(100000, "operate failed, please try again later", "操作失败，请稍后重试"),
    REDIS_ERROR_RETRY_LATER(100001, "Redis error, please try again later", "连接Redis异常，请稍后重试"),
    GET_K8S_CLUSTER_ERROR(100003, "get k8s cluster failed, please try again later", "获取k8s集群失败，请稍后重试"),
    GET_CONFIG_MAP_ERROR(100004, "get configMap failed", "查询configMap失败"),
    DELETE_CONFIG_MAP_ERROR(100005, "delete configMap failed", "删除configMap失败"),
    CREATE_CONFIG_MAP_ERROR(100006, "create configMap failed", "创建configMap失败"),
    UPDATE_CONFIG_MAP_ERROR(100007, "update configMap failed", "修改configMap失败"),
    GET_CRD_ERROR(100008, "get crd failed", "获取crd对象失败"),
    UPDATE_CRD_ERROR(100009, "update crd failed", "修改crd对象失败"),
    CREATE_CRD_ERROR(1000010, "create crd failed", "创建crd对象失败"),
    CREATE_DEPLOY_ERROR(1000011, "create deploy failed", "创建deploy对象失败"),
    GET_RESOURCE_ERROR(1000012, "get resource failed", "获取资源对象失败"),
    CREATE_STORAGE_CLASS_ERROR(1000013, "create storage class failed", "创建storageClass失败"),
    GET_STORAGE_CLASS_ERROR(1000014, "get storage class failed", "获取storageClass失败"),
    CREATE_PERSISTENT_VOLUME_ERROR(1000015, "create PersistentVolume failed", "创建PersistentVolume失败"),
    CREATE_PERSISTENT_VOLUME_CLAIM_ERROR(1000016, "create PersistentVolumeClaim failed", "创建PersistentVolumeClaim失败"),
    UNABLE_TO_LOAD_REDIS_CONF(1000017, "Unable to load redis.conf", "无法加载redis配置文件"),
    DELETE_REDIS_EVENTS_FAILED(1000018, "delete redis events failed", "删除 redis event 失败"),
    DELETE_REDIS_POD_FAILED(1000019, "delete redis pod failed", "删除 redis pod 失败"),
    CREATE_JOB_FAILED(1000020, "create job failed", "创建job失败"),
    GET_JOB_FAILED(1000021, "get job failed", "获取job失败"),
    DELETE_JOB_FAILED(1000022, "delete job failed", "删除job失败"),
    GET_JOB_LIST_FAILED(1000023, "get job list failed", "获取 job list失败"),
    GET_POD_LIST_FAILED(1000024, "get pod list failed", "获取 pod list失败"),
    GET_POD_LOG_FAILED(1000025, "get pod log failed", "获取 pod log 失败"),
    DELETE_JOB_LIST_BY_SELECTOR_FAILED(1000026, "delete jobs by selector failed", "删除jobs失败"),
    GET_END_POINT_FAILED(100027, "get endPoints failed", "获取endpoints失败"),
    JSON_CONVERT_ERROR(100002, "json convert error", "json转换异常"),
    GET_EVENTS_FAILED(100028, "get events failed", "获取event事件失败"),
    DELETE_PERSISTENT_VOLUME_CLAIM_ERROR(1000029, "delete PersistentVolumeClaim failed", "删除PersistentVolumeClaim失败"),
    DELETE_PERSISTENT_VOLUME_ERROR(1000030, "delete PersistentVolume failed", "删除PersistentVolume失败"),
    GET_PERSISTENT_VOLUME_ERROR(1000031, "get PersistentVolume failed", "获取PersistentVolume失败"),
    UPDATE_PERSISTENT_VOLUME_CLAIM_ERROR(1000032, "update PersistentVolumeClaim failed", "修改PersistentVolumeClaim失败"),
    GET_POD_FAILED(1000033, "get pod failed", "获取 pod 失败"),
    CREATE_POD_FAILED(1000067, "create pod failed", "创建 pod 失败"),
    GET_SVC_FAILED(1000034, "get svc failed", "获取 svc 失败"),
    GET_DEPLOY_FAILED(1000054, "get deploy failed", "获取 deploy 失败"),
    GET_OPERATOR_FAILED(1000055, "get operator failed", "当前暂无可用的operator"),
    UPDATE_REDIS_CACHE_FAILED(1000056, "update redis cache failed", "更新redis集群信息失败"),
    DELETE_CRD_FAILED(1000057, "delete crd failed", "删除crd失败"),
    MQ_CLUSTER_DATA_MIGRATION_FAILED(302032, "mq cluster data Migration failed", "mq集群数据迁移失败"),
    GET_STS_FAILED(1000058, "get sts failed", "获取sts失败"),
    UPDATE_OSS_CONFIG_FAILED(1000059, "update oss config failed", "更新oss配置文件失败"),
    CREATE_OSS_CONFIG_FAILED(1000060, "create oss config failed", "创建oss配置文件失败"),
    NOT_FOUND_POD_FOR_BACKUP(1000061, "not found pod for backup", "没有找到可以用来备份的节点"),
    CLUSTER_IS_PAUSE(1000062, "cluster is pause", "集群正在进行维修,无法进行其他操作"),
    MQ_CLUSTER_RESTART_ERROR(1000063, "mq cluster restart error", "mq集群重启失败"),
    CLUSTER_STATUS_IS_PAUSE(1000064, "cluster status is pause", "集群已开启/关闭维修状态"),
    UPDATE_CLUSTER_STATUS_IS_PAUSE_FAILED(1000065, "update cluster status is pause error", "更新集群维修状态失败,请稍后再试"),
    CLUSTER_PAUSE_STATUS_NOT_OPEN(1000066, "cluster pause status is false", "维修状态尚未打开,请稍后再试"),
    CLUSTER_PAUSE_STATUS_OPEN(1000067, "cluster pause status is true", "mq正在进行维修,无法进行其他操作"),
    GET_NODE_LIST_FAILED(1000068, "get node list failed", "获取 node list失败"),

    // 通用错误 1xxxxx
    UNKNOWN(100001, "System error, please contact Administrator.", "系统错误，请联系系统管理员"),
    INVALID_PARAMETER(100002, "Invalid parameter.", "参数错误"),
    INVALID_CONFIG(100003, "Invalid Config.", "配置错误"),
    PARAMETER_VALUE_NOT_PROVIDE(100004, "Parameter cannot be null.", "参数不能为空"),
    PASSWORD_NEW_END_EQ(200019, "New password same with old password", "新密码和旧密码相同"),
    PASSWORD_OLD_ERROR(200020, "Old password is not correct", "原始密码不正确"),
    INVALID_USERNAME(200021, "User name was invalid.", "无效的用户名"),
    USER_EXIST(200022, "User exist.", "用户已经存在"),
    USER_NOT_LOGIN(200023, "User not login or timeout.", "用户未登录或登录超时|User not login or timeout."),
    USER_STATUS_CHANGED(200024, "User status had already been changed", "用户状态已被更改"),
    USER_PERMISSION_DENIED(200025, "Permission denied.", "权限不足"),
    USER_NOT_AUTH_OR_TIMEOUT(200026, "User login timeout", "用户未授权或登录超时|User not authorized or timeout"),
    USER_GROUP_DELETE_FAIL(200027, "Delete user group failed.", "删除用户组失败"),
    USER_GROUP_CREATE_FAIL(200028, "Create user group failed.", "创建用户组失败"),
    USER_GROUP_NOT_EXIST(200029, "User group not exist.", "用户组不存在"),
    USER_GROUP_BIND_TENANT(200030, "The user group is already bound to the tenant.", "用户组已经绑定租户"),
    USER_BIND_TENANT(200031, "The user is already bound to the role.", "用户已经绑定角色"),
    USER_GROUP_EXIST(200032, "User group was exist.", "用户组已经存在"),
    USER_PERMISSION_DENIED_FOR_PRIVILEGE_CHANGE(200033, "Privilege has changed,permission denied.", "权限被管理员修改,权限不足"),
    USERNAME_COMMENT_BLANK(200034, "User comment can not be blank.", "用户信息不能为空"),
    USER_LABEL_ADD_FAIL(200035, "The label already exists", "标签已经存在"),
    UNSELECTED_USER(200036, "Unselected user", "未选择用户"),

    // 租户 201xxx
    TENANTNAME_EXIST(201001, "TenantName was existed.", "租户简称已经存在"),
    TENANTALIASNAME_EXIST(201002, "Name was existed.", "租户名已经存在"),
    INVALID_TENANTID(201003, "TenantId was invalid.", "无效的租户id"),
    INVALID_TENANTNAME(201004, "TenantName was invalid.", "无效的租户名"),
    TENANT_TM_EXIST(201005, "Tenant  was existed.", "租户管理员已经存在"),
    TENANT_NETWORK_EXIST(201006, "Tenant network was existed.", "租户网络已创建"),
    TENANT_NODE_EXIST(201007, "Tenant private node was existed.", "租户独占主机已经存在"),
    TENANT_NODE_NOT_EXIST(201008, "Tenant private node was not existed.", "租户独占主机不存在"),

    // 项目 202xxx
    PROJECT_EXIST(202001, "Project was existed.", "项目已经存在"),
    PROJECTID_NOT_BLANK(202002, "ProjectId can not be blank.", "项目id不能为空"),
    PROJECTNAME_NOT_BLANK(202003, "ProjectName can not be blank.", "项目名不能为空"),
    INVALID_PROJECTID(202004, "ProjectId was invalid.", "无效的项目id"),
    INVALID_PROJECTNAME(202005, "ProjectName was invalid.", "无效的项目名"),
    PROJECT_NOT_EXIST(202006, "Project was not existed.", "项目不存在"),
    PROJECT_ROLE_NOT_EXIST(202007, "Role was not existed.", "项目角色不存在"),
    PROJECTNAME_EXIST(202008, "ProjectName was existed.", "项目简称已经存在"),
    PROJECTALIASNAME_EXIST(202009, "Name was existed.", "项目名已经存在"),
    PROJECT_TM_EXIST(202010, "project was existed.", "项目管理员已经存在"),
    PROJECT_DELETE_FIRST(202011, "please delete project first", "请先删除项目"),
    PROJECT_ROLE_EXIST(202012, "Role was existed.", "项目角色已经存在"),
    PROJECT_PM_CANNOT_DELETE(202013, "PM cannot delete yourself.", "项目管理员不能删除自己!"),

    // 角色权限 203xxx
    ROLE_NOT_EXIST(203001, "Role not exist.", "角色不存在!"),
    ROLE_EXIST(203002, "Role exist.", "角色已经存在!"),
    PRIVILEGE_EXIST(203003, "Privilege exist.", "权限操作已经存在!"),
    PRIVILEGE_NOT_EXIST(203004, "Privilege not exist.", "权限操作不存在!"),
    ROLE_ID_BLANK(203005, "Role Id can not be blank", "角色ID不能为空!"),
    ROLE_USER_EXIST(203006, "The role have user bindings.", "角色有用户绑定!"),
    ROLE_SCOPE_NOT_BLANK(203007, "Role scope can not be blank.", "角色作用域不能为空!"),
    ROLE_PRIVILEGE_REPLICATION_NOT_BLANK(203008, "Privilege replication not exist.", "权限副本未找到!"),
    RESET_INIT_ROLE_NOLY(203009, "Only the original roles can be reset", "只能重置初始角色!"),
    INVALID_USER_TYPE(203010, "UserType was invalid", "无效的角色类型！"),
    LOCAL_ROLE_BINDING_CAN_NOT_DELETE(203011,
            "The local role is binding. Please inform tenant admins unbinding users firstly",
            "局部角色已经绑定用户，请先通知相关租户管理员接触绑定!"),
    LOCAL_ROLE_RESOURCE_RULE_NOT_EXIST(203012, "Resource rule not exist", "资源规则不存在"),
    LOCAL_ROLE_CONVERT_SQL_CONDITION_FAILED(203013, "Convert sql condition of privilege failed", "转换sql条件失败，请检查原json"
            + "格式是否有误"),
    LOCAL_ROLE_DATA_PRIVILEGE_FAILED(203014, "Data privilege not enough", "数据权限不足"),
    INIT_ROLE_CANNOT_DISABLE(203015, "You cannot disable the original role.", "不能禁用初始角色!"),
    SWITCH_ROLE_INCORRECT(203016, "The current state of the user is not available,please login again.",
            "用户当前状态不可用，请重新登录|The current state of the user is not available,please login again."),
    SWITCH_TENANT_INCORRECT(203017, "The switching tenant is not in the user's toggle list.", "切换的租户不在用户可切换的列表之内"),
    URL_PERMISSION_DENIED(203018, "Url is not registered，please contact the administrator to register.", "URL"
            + "未注册，请联系管理员注册URL！"),
    INIT_ROLE_CANNOT_DELETE(203019, "You cannot delete the original role.", "不能删除默认角色!"),
    ROLE_MENU_NOT_EXIST(203020, "Role menu was not existed.", "角色菜单不存在!"),
    LOCAL_ROLE_USER_NOT_IN_CURRENT_PROJECT(203021, "User is not in current project", "用户不在当前项目下"),
    LOCAL_ROLE_ALREADY_ASSIGNED_TO_USER(203022, "The role already assigned to this user", "该角色已分配给该用户"),
    ROLE_PRIVILEGE_NOT_ASSIGNED(203023, "User role privilege not assigned.", "当前用户所属角色未分配权限"),
    ROLE_DISABLE(203024, "User roles are disabled.", "当前用户角色被停用，请联系管理员|User roles are disabled."),
    ROLE_PRIVILEGE_NOT_BLANK(203025, "Role privilege can not be blank.", "角色权限不能为空!"),
    ROLE_PRIVILEGE_CANNOT_UPDATE(203026, "Admin role privilege can not be update.", "管理员角色权限不能被修改"),
    ADMIN_ROLE_CANNOT_DISABLE(203027, "Admin cannot be disabled.", "不能禁用管理员"),
    VALIDATION_CODE_IS_ERROR(203028, "Validation code error please re-enter.", "验证码错误请重新输入"),
    VALIDATION_CODE_DOES_NOT_EXIST(203029, "validation code does not exist,please try again", "验证码不存在或已过期，请重新发送"),
    VALIDATION_CODE_CAN_NOT_BE_EMPTY(203030, "validation code can not be empty,please try again", "验证码不能为空，请重新输入"),

    // 集群相关错误代码 300xxx
    K8S_CLUSTER_NAME_IS_NULL(302001, "K8S Cluster Name Is Null ", "K8S集群名称不能为空"),
    K8S_CLUSTER_NOT_EXIST(302002, "K8S Cluster Not Exits ", "当前查询的K8S集群不存在"),
    REDIS_CLUSTER_ROLLBACK_UPDATE_ID_BLANK(302000, "updateId can not be blank", "updateId不能为空"),
    REDIS_CLUSTER_ROLLBACK_SLOTS_FAILED(301999, "slot migrate can not be rollback", "卡槽迁移失败不能回滚"),
    REDIS_CLUSTER_ROLLBACK_FAILED_WHEN_UPGRADING(301998, "cluster can not be rollback by current state", "集群当前状态不允许回滚"),
    ES_CLUSTER_NAME_IS_NULL(302003, "ES Cluster Name Is Null ", "ES集群名称不能为空"),
    ES_CLUSTER_STATE_UNAVAILABILITY(302004, "ES Cluster State Unavailability", "当前ES集群状态不可用,请检查输入ES集群名称是否正确或稍后再试"),
    ES_CLUSTER_DELETE_FAIL(302005, "ES Cluster Delete Fail", "ES集群删除失败"),
    ES_CLUSTER_STATUS_UNKNOWN(302006, "ES Cluster Status Unknown", "ES集群状态未知,更新失败"),
    CLUSTER_NAME_DUPLICATE(300001, "Cluster Name Duplicate.", "集群名称已存在"),
    REIDS_CLUSTER_NAME_DUPLICATE(300301, "Redis Cluster Name Duplicate.", "集群已存在或失败回滚未完成,请稍后重试"),
    REIDS_CLUSTER_NAME_EXIST(300302, "Redis Cluster Not Exist.", "Redis集群不存在"),
    REIDS_CLUSTER_UPDATE_TO_ID_NOT_EXIST(300303, "Redis Cluster Not Exist that updateToId", "不存在updateToId版本的Redis集群"),
    CLUSTER_HOST_EXIST(300002, "Cluster Host Exist.", "集群主机已存在"),
    NODE_CONNECT_ERROR(300003, "Can not connect to node server.", "服务器连接失败"),
    CLUSTER_CONNECT_ERROR(300004, "Can not connect to cluster api server.", "连接集群ApiServer失败"),
    HARBOR_VERIFY_ERROR(300005, "Harbor info verified error.", "验证harbor信息失败"),
    ADD_CLUSTERQUOTA_INCORRECT(300006, "Cluster quota incorrect.", "添加的配额不正确"),
    CLUSTERID_NOT_BLANK(300007, "Cluster id can not be blank.", "集群id不能为空"),
    IMG_SYNC_CLUSTER_LEVEL_NOT_MATCH(300008, "Source cluster level is bigger than target.", "原集群权重大于目标集群"),
    CLUSTER_NOT_FOUND(300009, "K8S Cluster not found.", "未找到K8S集群"),
    ES_CLUSTER_NOT_FOUND(300059, "ES Cluster not found.", "未找到ES集群"),
    ES_CLUSTER_NOT_READY(300060, "ES Cluster not ready.", "ES集群尚未准备好"),
    NAMESPACE_MEMORY_TYPE_ERROR(300010, "Memory type error.", "错误的内存配额"),
    CLUSTER_NAME_UNUPDATE(300011, "Cluster name can not update", "集群名字不可以修改"),
    CLUSTER_BODY_DATA_ERROR(300012, "Cluster body data is error", "传递body数据有问题"),
    DATA_CENTER_QUERY_FAIL(300013, "Fail to query data center", "获取数据中心失败"),
    CLUSTER_STATUS_QUERY_FAIL(300014, "Fail to get cluster status.", "获取集群状态信息错误"),
    CLUSTER_SERVICE_PORT_ERROR(300015, "Service port error.", "服务端口错误"),
    CLUSTER_ES_SERVICE_ERROR(300016, "Cant not connect to es service.", "集群es组件连接失败"),
    CLUSTER_DATA_INIT_ERROR(300017, "Cluster data init error.", "集群信息初始化失败"),
    CLUSTER_TOKEN_ERROR(300018, "Cluster token error.", "获取集群访问k8s apiserver的令牌失败"),
    CLUSTER_LIST_NOT_BLANK(300019, "Cluster list can not blank.", "集群列表不能为空"),
    MEMORY_QUOTA_OVER_FLOOR(300020, "Memory quotas exceed available quotas.", "memory配额超过可使用的配额"),
    RESOURCE_QUOTA_NOT_LESS_ZERO(300021, "Resource quota error.", "资源配额错误"),
    CLUSTER_RESOURCE_NOT_ZERO(300022, "Cluster resource can not be zero.", "集群总资源不能为零"),
    NETWORK_ALREADY_BIND(300023, "Network has been binding.", "网络已经被绑定"),
    CLUSTER_STATUS_NOT_NEED_UPDATE(300024, "Cluster status is identical, no need to update.", "集群状态一致，不需要更新"),
    CPU_QUOTA_OVER_FLOOR(300025, "CPU quotas exceed available quotas.", "cpu配额超过可使用的配额"),
    TEMPLATE_NOT_FOUND(300026, "Template not found", "模板查询错误"),
    TEMPLATE_STATUS_NOT_DELETE(300027, "Template status(use) is true", "模板状态为已经被使用，不可删除"),
    TEMPLATE_NAME_CAN_NOT_UPDATE(300028, "Template name can not be update", "模板名字不允许更新"),
    NODE_NOT_FIND_IN_CLUSTER(300029, "No node in cluster.", "集群内没有主机"),
    DOCKER_CONNECT_TYPE_NOT_SET(300030, "Docker connect type is not set.", "未设置docker连接方式"),
    CLUSTER_DATA_DELETE_FAIL(300031, "Cluster data delete fail.", "删除集群数据失败"),
    CLUSTER_DELETE_FAIL(300060, "Cluster delete fail.", "删除集群失败"),
    CLUSTER_NOT_IN_SCOPE(300032, "Cluster is not in the available list.", "集群不在用户能操作的范围之内"),
    DATACENTER_HAS_CLUSTER(300033, "Datacenter has cluster ", "该数据中心有集群，不可删除"),
    ROLE_HAVE_DISABLE_CLUSTER(300034, "No cluster or cluster is disabled for this role.", "该角色没有集群或者集群被停用"),
    DATACENTER_NOT_HAS_NICENAME(300035, "Datacenter do not have nickname.", "该数据中心没有别名"),
    DATACENTER_NICENAME_SAME(300036, "New nickname is same with old nickname.", "别名一致"),
    DATACENTER_UPDATE_FAIL(300037, "Datacenter update fail", "该数据中心更新失败"),
    LIST_CLUSTERQUOTA_INCORRECT(300038, "Get cluster quota failed.", "获取配额失败"),
    RESOURCE_OVER_FLOOR(300039, "Resource quotas should not be less than allocated quotas.", "资源配额不能少于已分配的配额"),
    UPDATE_CLUSTERQUOTA_INCORRECT(300040, "Cluster quota incorrect，please refresh the page resource.", "配额不正确,"
            + "请重新刷新页面资源"),
    DATACENTER_NAME_DUPLICATE(300041, "Datacenter Name Duplicate.", "数据中心名称已存在"),
    INGRESS_CONTROLLER_NOT_FOUND(300042, "The ingress controller not found under the cluster.", "集群下没有找到该负载均衡器"),
    INGRESS_CONTROLLER_PORT_RANGE_NOT_FOUND(300043, "Cannot get the port range of the ingress controller.",
            "获取不到负载均衡器的端口范围"),
    INGRESS_CONTROLLER_EXIST(300044, "The ingress controller already exists.", "负载均衡器已经存在"),
    INGRESS_CONTROLLER_HTTP_PORT_USED(300045, "The http port of the ingress controller has been used.", "负载均衡器HTTP"
            + "端口已经被使用"),
    INGRESS_CONTROLLER_OTHER_PORT_USED(300046, "The other port of the ingress controller has been used.",
            "负载均衡器其他端口已经被使用"),
    INGRESS_CONTROLLER_SA_NOT_FOUND(300047, "Cannot get the default serviceAccount under the kube-system namespace.",
            "获取不到kube-system分区下默认的serviceAccount"),
    INGRESS_CONTROLLER_DEFAULT_NOT_DELETE(300048, "The default ingress controller is not allowed to be deleted.",
            "默认负载均衡器不允许被删除"),
    INGRESS_CONTROLLER_HAS_ASSIGN(300049, "The ingress controller has been assigned.", "该负载均衡器已经被分配"),
    INGRESS_CONTROLLER_PORT_UPDATE_FAIL(300050, "In the database, the ingress controller port data update failed, "
            + "please contact the administrator.", "数据库中，ingress controller端口数据更新失败，请联系管理员"),
    INGRESS_CONTROLLER_HAS_USED_BY_TENANTS(300051, "The assignment was successful. Some tenants have used a ingress "
            + "controller and cannot remove tenants:", "分配成功。部分租户已使用负载均衡器，无法移除租户："),
    INGRESS_CONTROLLER_HTTP_PORT_ERROR(300052, "The port of the ingress controller is not in the specified range.",
            "负载均衡器的端口不在指定范围"),
    INGRESS_CONTROLLER_CONFIG_MAP_ERROR(300053, "The template name of configMap of the ingress controller is blank.",
            "负载均衡器的配置文件模板名称为空"),
    INGRESS_CONTROLLER_CONFIG_MAP_TEMPLATE_ERROR(300054, "Get the template of configMap of the ingress controller "
            + "failed.", "获取负载均衡器的配置文件模板失败"),
    RESOURCE_DELETE_ERROR(300055, "The usage of the persistentVolume of.the cluster is not zero,can not delete",
            "当前集群存储配额使用不为0，无法移除"),
    INGRESS_CONTROLLER_HTTPS_PORT_USED(300056, "The https port of the ingress controller has been used.", "负载均衡器HTTPS"
            + "端口已经被使用"),
    INGRESS_CONTROLLER_HTTPS_NO_NODE(300056, "There are no node for labers.", "此laber规则无负载均衡节点可用"),
    INGRESS_CONTROLLER_NGINX_CONF_ERROR(300057, "The ingress controller server or map configuration is error, please "
            + "check in service group.", "该负载均衡器的server和map配置有误,请检查分流服务组配置."),
    INGRESS_CONTROLLER_NOT_EXITS_OR_REMOVED(300058, "The ingress controller not exits or removed.", "负载均衡器不存在或已被移出租户"),
    INGRESS_GET_FAILED(30059, "get ingress failed", "apiserver获取ingress异常"),
    INGRESS_GET_NOT_EXISTS(30060, "get ingress not exists", "获取ingress为空"),
    INGRESS_CONTROLLER_GET_NOT_REGISTER(30061, "ingress controller not register", "查询ingress controller没有配置"),
    INGRESS_CONTROLLER_NO_AVAILABLE(30062, "not ingress controller is available", "集群中没有可用ingress controller"),
    INGRESS_CONTROLLER_ALL_IS_FULL(30062, "all ingress controller is full", "集群中ingress controller都已达纳管上限"),

    // 主机节点 301xxx
    NODE_LABEL_CREATE_ERROR(301001, "Node label create failed.", "主机标签创建失败"),
    NODE_LABEL_ERROR(301002, "Node label error.", "主机标签错误"),
    NODENAME_NOT_BLANK(301003, "Node name can not blank.", "主机名称不能为空"),
    NODE_NOT_EXIST(301004, "Node was not existed.", "主机不存在"),
    NODE_EXIST(301005, "Node was existed.", "主机已经存在"),
    WORK_NODE_OFFLINE(301006, "Work node can not removed.", "工作主机不能下线"),
    DRAIN_IN_PROCESS(301007, "There is already a migrate progress in process.", "主机应用迁移已在进行中"),
    NODE_STATUS_REQUIRE(301008, "Only allow for idle or stateless node", "只能修改闲置主机或者无状态主机"),
    PRIVATE_NODE_NOT_EXIST(301009, "Warn: Can not find private node for this namespace, node label has been modified",
            "警告：已经删除当前分区，但是当前分区为私有分区，所属独占主机属性被修改，导致独占主机不存在，请不要随意更改主机私有属性，以免发生冲突，如果在接下来的操作中遇到其它问题，请联系管理员!"),
    NODE_NOT_REMOVE(301010, "The node has other pods ,please delete it.", "主机有其他应用pod，请删除pod后再移除"),
    NODE_POD_NONE(301011, "There is no pod on the node.", "主机上没有运行pod"),
    NODE_CANNOT_REMOVED(301012, "Node can not be removed.", "主机已经分配给租户不能下线，请在对应的租户配额中移除该主机后下线!"),
    NODE_CANNOT_REMOVED_FORTENANT(301013, "Node can not be removed.", "主机已经分配给分区不能移除，请在对应的分区中移除该主机!"),
    NODE_LABEL_UPDATE_ERROR(301014, "Node status update failed.", "主机状态更新失败"),
    NODE_UNSCHEDULABLE_ONLY(301015, "Only allow for maintain node.", "只允许操作维护状态主机"),
    NODE_STATUS_NOT_REMOVE(301016, "The node has other pods ,please drain application.", "主机有其他应用pod，请应用迁移后再修改"),

    // 分区 302xxx
    NAMESPACE_NOT_BLANK(302001, "Namespace name can not be blank.", "分区名不能为空"),
    NAMESPACE_NOT_FOUND(302002, "Namespace not found.", "分区未找到"),
    NAMESPACE_EXIST(302003, "Namespace was existed.", "分区已经存在"),
    NAMESPACE_CREATE_ERROR(302004, "Create namespace failed.", "分区创建失败"),
    NAMESPACE_QUOTA_CREATE_ERROR(302005, "Create namespace quota failed.", "分区配额创建失败"),
    NAMESPACE_POLICY_CREATE_ERROR(302006, "Create namespace policy failed.", "分区策略创建失败"),
    NAMESPACE_HA_POLICY_CREATE_ERROR(302007, "Create namespace HA policy failed.", "分区HA策略创建失败"),
    NAMESPACE_QUOTA_NOT_BLANK(302008, "Namespace quota can not blank.", "分区配额不能为空"),
    INVALID_NS_NAME(302009, "Namespace was invalid.", "无效的分区名"),
    NAMESPACE_DELETE_FIRST(302010, "Please delete namespace first", "请先删除分区"),
    PRIVATE_NAMESPACE_ONLY(302011, "Only private namespaces are allowed.", "只允许操作私有分区"),
    NAMESPACE_CREATE_ERROR_DELETED(302012, "Namespace is being deleted: namespaces already exists.", "分区正在被删除的过程中,"
            + "请稍后创建!"),
    ES_CLUSTER_OTHER_RESOURCE_DELETE_FAILED(302013, "es_cluster_other_resource_delete_failed", "删除ES集群相应资源失败"),

    // 应用 400xxx
    SCRIPT_NOT_EXIST(400001, "Script file not found.", "脚本文件未找到"),
    TOPOLOGY_NOT_EXIST(400002, "Network topology not existed.", "网络拓扑图不存在"),
    TOPOLOGY_EXIST(400003, "Network topology was existed.", "网络拓扑图已存在"),
    TOPOLOGY_ADD_FAIL(400004, "Topology addPo fail.", "网络拓扑图添加失败"),
    DAEMONSET_EXIST(400005, "DaemonSet Exist.", "DaemonSet已存在"),
    DAEMONSET_CREATE_FAILURE(400006, "Create DaemonSet failure.", "创建DaemonSet失败"),
    DAEMONSET_UPDATE_FAILURE(400007, "Update DaemonSet failure.", "更新DaemonSet失败"),
    DAEMONSET_GET_FAILURE(400008, "Get DaemonSet failure.", "获取DaemonSet失败"),
    DAEMONSET_NOT_EXIST(400009, "DaemonSet not exist.", "DaemonSet不存在"),
    DAEMONSET_DETAIL_GET_FAILURE(400010, "Get detail of DaemonSet failure.", "获取DaemonSet详情失败"),
    CONFIG_MAP_IS_EXIST(400011, "ConfigMap not exist.", "configMap已经存在"),
    CONFIG_MAP_CREATE_FAIL(401009, "ConfigMap create failure.", "configMap创建失败"),
    CONFIG_MAP_DELETE_FAIL(401010, "ConfigMap delete failure.", "configMap删除失败"),
    POD_NOT_EXIST(400012, "Pod not exist.", "POD不存在"),
    DEPLOYMENT_NOT_FIND(400013, "Service not found.", "服务未找到"),
    DEPLOYMENT_GET_FAILURE(400014, "Get Service failure.", "获取服务失败"),
    DEPLOYMENT_UPDATE_FAILURE(400015, "Update Service failure.", "更新服务失败"),
    DEPLOYMENT_NAME_DUPLICATE(400016, "Service name duplicate:", "服务名称已存在:"),
    HTTP_INGRESS_NAME_DUPLICATE(400017, "HTTP Service name duplicate.", "HTTP服务名称已存在"),
    TCP_INGRESS_NAME_DUPLICATE(400018, "Expose port in use or HTTP Service name duplicate.", "对外暴露端口被使用或HTTP服务名称已存在"),
    APPLICATION_NAME_DUPLICATE(400019, "Application name duplicate.", "应用名称已存在"),
    APPLICATION_CREATE_ROLLBACK_FAILURE(400020, "Create application rollback failure.", "创建应用时回滚失败"),
    DEPLOYMENT_CANARY_SCALE_FAILURE(400021, "Canary update service failure.", "灰度升级失败"),
    DEPLOYMENT_PAUSE_CANARY_SCALE_FAILURE(400022, "Pause canary update service failure.", "暂停灰度升级失败"),
    DEPLOYMENT_SCALE_INSTANCE_FAILURE(400023, "Scale instance failure.", "手动伸缩实例失败"),
    APPLICATION_CREATE_FAILURE(400024, "Create application failure.", "应用创建失败"),
    SERVICE_DELETE_FAILURE(400025, "Delete service failure.", "服务删除失败"),
    TCP_SERVICE_DELETE_FAILURE(400026, "Delete TCP Service failure.", "TCP服务删除失败"),
    SERVICE_CREATE_ROLLBACK_FAILURE(400027, "Create service rollback failure.", "创建服务时回滚失败"),
    SERVICE_CREATE_FAILURE(400028, "Create service failure.", "创建服务失败"),
    SERVICE_BLUE_GREEN_FAILURE(400029, "Service blue-green deploy failure.", "蓝绿发布失败"),
    SERVICE_BLUE_GREEN_SWITCH_FLOW_FAILURE(400030, "Service blue-green deploy failure.", "流量切换失败"),
    SERVICE_BLUE_GREEN_UPDATE_FAILURE(400031, "Service blue-green update failure.", "蓝绿发布升级失败"),
    SERVICE_BLUE_GREEN_ROLLBACK_FAILURE(400032, "Service blue-green rollback failure.", "蓝绿发布回滚失败"),
    EXT_SERVICE_DELETE_FAIL(400033, "external service delete error", "外部服务删除失败"),
    SYSTEM_NGINX_CONFIGMAP_NOT_FIND(400034, "External router not find.", "对外访问路由不存在"),
    POD_IS_BLANK(400035, "Pod can not be blank.", "未选择pod"),
    SYSTEM_NO_EXTERNAL_PORT_IN_CLUSTER(400036, "No external port can be used in the cluster.", "集群内没有可用对外端口"),
    SERVICE_NOT_READY(400037, "Service is starting, please try later.", "服务正在启动，请稍后再试"),
    JOB_FINISHED(400038, "job had finished or failed", "Job已经完成或者失败了"),
    APP_DELETE_FAILED(400039, "App delete failure", "应用删除失败"),
    NS_POD_CONTAINER_NOT_BLANK(400040, "deploy pod and container can not be blank at same.", "服务名、pod名称和容器名称不能都为空"),
    NAMESPACE_RESOURCE_INSUFFICIENT(400041, "Namespace resource insufficient.", "分区cpu或内存不足"),
    CONFIGMAP_IS_EMPTY(400042, "ConfigMap is blank.", "配置文件内容为空"),
    APPLICATION_NAME_CONFLICT_MSF(400043, "Application name belong to micro service component", "应用名称所属于微服务组件"),
    SERVICE_EXPOSE_NGINX_FAILED(400044, "Port and protocol is different from in containers.", "选择的端口或协议与容器内的不一致"),
    APPLICATION_CAN_NOT_STOP(400045, "Service in application in the upgrade.", "所属服务的状态处于灰度或蓝绿升级中."),
    SERVICE_TYPE_NOT_EXIST(400046, "ServiceType was not existed.", "服务类型不存在"),
    APP_SERVICE_DELETE_FAILED(400047, "App service delete failure", "服务删除失败，请联系管理员"),
    APP_SERVICE_GET_DEPLOYMENT_FAILED(400052, "Get cluster quota failed", "服务中获取deployment失败，请联系管理员"),
    APP_SERVICE_DEPLOYMENT_DELETE_FAILED(400048, "App service deployment delete failure", "服务中deployment资源删除失败，请联系管理员"),
    APP_SERVICE_CONFIGMAP_DELETE_FAILED(400049, "App service configmap delete failure", "服务中configmap资源删除失败，请联系管理员"),
    APP_SERVICE_INGRESS_DELETE_FAILED(400050, "App service ingress delete failure", "服务中ingress删除失败，请联系管理员"),
    APP_SERVICE_GET_INGRESS_FAILED(400051, "Get ingress delete failure", "服务中ingress删除失败，请联系管理员"),
    APP_SERVICE_INGRESS_PORT_USED(400053, "The http port of the ingress controller has been used.", "端口已经被使用"),
    SERVICE_GROUP_CONF_USING(400054, "The service group config file is in use.", "该配置文件正在使用，无法删除"),
    SERVICE_GROUP_NOT_EXIST(400055, "The service group does't exist.", "该服务组不存在"),
    SERVICE_GROUP_CONF_ERROR(400056, "The nginx config file is error.", "该nginx配置文件格式有错，请检查"),
    SERVICE_GROUP_CONF_NOT_EXIST(400057, "The nginx config file does't exist.", "该nginx配置文件不存在，请检查"),
    SERVICE_IN_GROUP(400058, "Service is used by service group, can not delete.", "服务被分流服务组使用，不能删除"),
    SERVICE_GROUP_CONF_WARN(40059, "The nginx config file has warnning.", "该nginx配置文件格式有异常"),

    // 模板 401xxx
    SERVICE_TEMPLATE_NOT_EXIST(401001, "Service template not exist.", "服务模板不存在"),
    TEMPLATE_SEARCH_KEY_ERROR(401002, "Application template search key error.", "查询模板的关键字key错误"),
    SERVICE_TEMPLATE_NOT_BLANK(401003, "Service template cannot be blank.", "服务模板不能为空"),
    APPLICATION_TEMPLATE_NOT_EXIST(401004, "Application template not exist.", "应用模板不存在"),
    APPLICATION_TEMPLATE_GET_FAILURE(401005, "Get application template failure.", "应用模板获取失败"),
    SERVICE_TEMPLATE_NOT_EXIST_IN_APPLICATION_TEMPLATE(401006, "Service template not exist in application template.",
            "在应用模板内没有服务模板"),
    SERVICE_TEMPLATE_IMAGE_INFO_NOT_NULL(401007, "Image info not exist in service template.", "服务模板内不存在镜像信息"),
    APPLICATION_TEMPLATE_NAME_DUPLICATE(401008, "Application template name duplicate", "应用模板名称已存在"),
    SERVICE_TEMPLATE_NAME_DUPLICATE(401009, "Service template name duplicate", "服务模板名称已存在"),

    // 存储 402xxx
    PV_DELETE_FAIL(402001, "Fail to delete PV.", "PV删除失败"),
    PV_CREATE_FAIL(402002, "Fail to create PV.", "创建集群存储失败"),
    PV_NAME_FORMAT_ERROR(402003, "PV name format error.", "PV名称格式错误"),
    PV_QUERY_FAIL(402004, "PV query fail.", "PV查询失败"),
    PV_CAN_NOT_DELETE(402006, "PV status is bound， not to delete.", "PV状态为bound，不允许删除"),
    PV_PROVIDER_NOT_EXIST(402005, "PV is not provided.", "PV存储未提供"),
    PV_RELEASE_FAIL(402006, "PV released failed.", "PV释放失败"),
    PV_RELEASE_NFS_ONLY(402007, "Only support nfs and yrfs pv release currently.", "目前只支持nfs和yrfs类型PV释放"),
    PVC_NOT_EXIST(402008, "PVC not exist.", "PVC存储不存在"),
    PVC_DELETE_FAILURE(402009, "PVC delete failure.", "PVC删除失败"),
    PVC_CREATE_FAILURE(402010, "PVC create failure.", "PVC创建失败"),

    // 弹性伸缩 403xxx
    SERVICE_AUTOSCALE_CREATE_FAILURE(403001, "Create cluster failure.", "集群操作失败"),
    SERVICE_AUTOSCALE_DELETE_FAILURE(403002, "Delete autoScale failure.", "自动伸缩删除失败"),
    AUTOSCALE_CONDITION_REQUIRE(403003, "can not create autoscale for TPS metric as application do not have create "
            + "service.", "该应用未对外创建服务，不能根据TPS指标伸缩"),
    AUTOSCALE_NOT_SELECTED(403004, "Please select a metric for autoscale", "至少需要设置一项伸缩指标"),
    AUTOSCALE_METRIC_NOT_SUPPORT(403005, "not support for metric", "不支持的伸缩指标"),
    AUTOSCALE_TIME_MAX_MIN_ERROR(403006, "Max,min replicas value is error", "max ,min 值错误"),
    AUTOSCALE_TIME_ZONE_ERROR(403007, "Time zone value is error", "负载均衡时间段错误"),
    SERVICE_AUTOSCALE_UPDATE_FAILURE(403008, "update cluster failure.", "更新集群失败"),
    AUTOSCALE_NOT_FOUND(403009, "Can not found cluster.", "找不到该集群"),

    // 日志管理 404xxx
    QUERY_LOG_TOPOLOGY_ERROR(404001, "Get topology failed.", "查询全链路拓扑图失败"),
    QUERY_LOG_CONTENT_ERROR(404002, "Get log content failed.", "查询全链路日志内容失败"),
    LIST_LOG_ERROR(404003, "list log file list error.", "获取服务日志列表失败"),
    LOG_EXPORT_FAILED(404004, "Log export failed", "导出日志失败"),
    APP_LOG_RULE_NOT_EXIST(404005, "App log not rule not exist", "应用日志规则不存在"),
    APP_LOG_SNAPSHOT_CREATE_REPO_FAILED(404006, "Failed to create snapshot repository", "创建快照仓库失败"),
    APP_LOG_SNAPSHOT_CREATE_FAILED(404007, "Failed to create snapshot", "创建快照失败"),
    APP_LOG_SNAPSHOT_QUERY_FAILED(404008, "Failed to query snapshot", "查询快照失败"),
    APP_LOG_SNAPSHOT_DELETE_FAILED(404009, "Failed to delete snapshot", "删除日志快照失败"),
    APP_LOG_SNAPSHOT_RESTORE_FAILED(404010, "Failed to restore snapshot", "恢复日志快照失败"),
    APP_LOG_REPO_MISSING(404011, "Repository missing. Please create a new snapshot", "快照仓库未找到，请先为该集群创建快照"),
    APP_LOG_SNAPSHOT_INDEX_NOT_EXIST(404012, "There is no log index for this day", "该日期没有产生日志"),
    LOG_SNAPSHOT_DATE_ERROR(404013, "log snapshot date error", "日志快照时间日期错误"),
    LOG_SNAPSHOT_NO_INDEX(404014, "No log for this date", "该日期没有日志"),
    LOG_SNAPSHOT_RESTORE_EXISTS(404015, "log has already been restored.", "日志已恢复"),
    LOG_SEARCH_TYPE_NOT_SUPPORT(404016, "search type not support.", "查询类型不支持"),

    // 镜像 405xxx
    IMAGE_SET_CLEAN_RULE_FAILED(405001, "Set Cleaning Rule failed", "设置清理规则失败"),
    IMAGE_SYNC_CREATE_DEST_HARBOR_PROJECT_FAILED(405002, "Create project in target harbor failed", "在目标Harbor中创建项目失败"),
    IMAGE_DELETE_DEFAULT_REPOSITORY_NOT_ALLOWED(405003, "Can not delete default repository", "默认镜像仓库不能删除"),
    IMAGE_CREATE_HARBOR_PROJECT_FAILED(405004, "Create harbor project failed", "创建Harbor project失败"),
    IMAGE_TARGET_REPOSITORY_NOT_EXIST(405005, "Target repository not exist.", "目标镜像仓库不存在"),
    IMAGE_SOURCE_DEPOSITORY_NOT_EXIST_NEED_PROJECT_NAME(405006, "Source repository not exist. Please input project "
            + "name", "原默认镜像仓库不存在，请输入项目名"),
    IMAGE_CREATE_REPOSITORY_FAILED(405007, "Create repository failed.", "创建镜像仓库失败"),
    IMAGE_REPOSITORY_NOT_FOUND(405008, "Image repository not found.", "镜像仓库不存在"),
    REPLICATION_EXIST(405009, "this repository had already created replication.", "仓库已创建同步规则"),
    REPLICATION_ENABLE(405010, "replication is enable, please stop first.", "同步规则已启用，请先停止"),
    REPLICATION_PROCESSING(405011, "please waiting for replication job stop.", "停用同步规则后需要等待正在进行的同步任务停止，请稍后删除"),
    REPLICATION_USING(405012, "please stop and delete replication first.", "请先停止并删除镜像仓库同步规则"),
    REPLICATION_STOPPING(405013, "old replication is stopping, please try later.", "正在停止原同步规则的同步任务，请稍后再试"),
    IMAGE_UPLOADING(405014, "image is uploading.", "镜像正在上传"),
    PUBLIC_REPOSITORY_DELETE(405015, "Public project can not be deleted.", "公共镜像仓库不能删除"),
    IMAGE_LOAD_ERROR(405016, "error to load image from file", "从文件中加载镜像失败"),
    IMAGE_UPLOAD_SINGLE(405017, "only support single image upload at once", "只支持单个镜像上传"),
    REPOSITORY_CREATE_FAIL(405018, "failed to create repository on harbor for cluster", "在以下集群对应的harbor上创建镜像仓库失败"),
    HARBOR_AUTH_ACCESS_FAIL(405019, "failed to authorize image repository access on harbor", "授权用户访问镜像仓库失败"),
    IMAGE_RULE_NAME_ALREADY_EXIST(405020, "Rule name already exists", "规则名称已经存在"),
    IMAGE_RULE_REPO_ALREADY_EXIST(405021, "Rule of the repository already exists", "仓库已创建规则"),
    HARBOR_QUERY_PROJECT_BY_REPOSITORY_FAILED(405022, "Query project by repository failed", "查询项目失败"),
    HARBOR_FIND_ERROR(405023, "Harbor server find error, host is", "查找harbor服务器错误, host:"),
    HARBOR_AUTH_FAIL(405024, "harbor auth fail", "harbor验证失败"),
    IMAGE_SYNC_NOT_FOUND(405025, "sync image error as not found repository for dest cluster", "镜像推送失败，未找到目标环境的镜像仓库"),
    IMAGE_LIST_ERROR(405026, "List image error", "查询镜像失败"),
    IMAGE_PUBLIC_SYNC_DENIED(405027, "Can not sync image to another cluster for public repository", "不能推送公共镜像仓库下的镜像"),
    IMAGE_PRD_SYNC_DENIED(405028, "Can not sync image to another cluster for production repository",
            "不能推送生产环境镜像仓库下的镜像"),
    IMAGE_SYNC_DEST_EXIST(405029, "Sync image error. Same image name and tag exist in dest repository", "推送失败,目标镜像已存在"),
    HARBOR_QUOTA_UPDATE_EXCEED(405030, "used size greater than quota size", "已经使用的磁盘用量超过要设置的配额"),
    REPLICATION_DELETE_FAIL(405031, "Replication policy delete error. Please delete manually.", "镜像同步规则删除失败，请手动删除"),
    REPOSITORY_DELETE_FAIL(405032, "failed to delete repository on harbor for cluster", "在以下集群对应的harbor上删除镜像仓库失败"),
    IMAGE_DOWNLOAD_PREPARE_ERROR(405033, "Image is not present, please pull images first.", "请先拉取镜像，然后下载镜像"),
    IMAGE_IN_PULLING(405034, "There is already a pulling process for this image, please wait", "镜像已经在拉取中，请等待"),
    IMAGE_IN_PULLING_DELETE_ERROR(405035, "Image is pulling, can not be delete now, please try later when image is "
            + "pulled", "镜像正在在拉取中，不能删除文件，请等待镜像文件已经生成之后删除"),
    HARBOR_PROJECT_QUOTA_EXCEED(405036, "Harbor project quota exceeds.", "仓库磁盘配额已用完"),
    HARBOR_IN_GARBAGE_CLEAN(405037, "Harbor is in garbage cleaning, pleas try later.",
            "镜像仓库正在清理镜像垃圾文件，请稍后再试"),
    PUBLIC_HARBOR_PROJECT_CLEAN_ACCESS(405038, "Public harbor project image clean rule is only allow for admin",
            "公共镜像仓库清理规则需要系统管理员权限可以设置"),
    HARBOR_COOKIE_INVALID(405039, "Harbor login timeout, please retry.", "Harbor登录超时，请重试"),
    HARBOR_PROTOCOL_INVALID(405040, "If harbor enabled https protocol, please use https replace http",
            "如果harbor启用https协议，请用https访问harbor"),
    IMAGE_DELETE_TIMEOUT(405041, "Maybe image file is too large to delete within 1 minutes, please check result later.",
            "可能由于镜像文件较多，未能在1分钟内全部删除，请稍后查询删除结果"),
    REPLICATION_TARGET_USING(405042, "Target server is used by replication rules, please delete replication rule "
            + "first.", "同步规则正在使用该备份服务器，请先删除同步规则"),
    IMAGE_IN_DELETING(405043, "This image is in deleting, please check later.", "镜像正在删除中,请稍后查看删除结果"),
    LARGE_IMAGE_DELETE(405044, "As image is large,it take some time to delete, please check later.",
            "由于镜像文件较大，需要一些时间删除，请稍后查看删除结果"),

    // CICD 406xxx
    ENVIRONMENT_NAME_NOT_BLANK(406001, "Build environment name can not be blank.", "环境名称不能为空"),
    ENVIRONMENT_NAME_DUPLICATE(406002, "Build environment name duplicate.", "环境名称已存在"),
    ENVIRONMENT_ADD_FAIL(406003, "Build environment addPo fail.", "新增环境失败"),
    ENVIRONMENT_DELETE_FAIL(406004, "Build environment delete fail.", "删除环境失败"),
    ENVIRONMENT_USED(406005, "Build environment is used by pipeline, can not be deleted.", "环境被流水线使用中，无法删除"),
    ENVIRONMENT_UPDATE_FAIL(406006, "Build environment update fail", "更新环境信息失败"),
    CLUSTER_ID_NOT_NULL(406007, "Cluster id can not be null.", "集群id不能为空"),
    PROJECT_ID_NOT_NULL(406008, "Project id can not be null.", "项目id不能为空"),
    DEPENDENCE_NAME_DUPLICATE(406009, "Dependence name duplicate.", "依赖名称已存在"),
    DEPENDENCE_CREATE_FAIL(406010, "Dependence create fail.", "依赖创建失败"),
    DEPENDENCE_NAME_NOT_BLANK(406011, "Dependence name can not be blank.", "依赖名称不能为空"),
    DEPENDENCE_DIRECTORY_LIST_FAIL(406012, "Dependence directory list fail.", "依赖目录查询失败"),
    DEPENDENCE_FILE_RM_FAIL(406013, "Dependence file remove fail.", "依赖文件删除失败"),
    DEPENDENCE_FILE_UPLOAD_FAIL(406014, "Dependence file upload fail.", "依赖文件上传失败"),
    PARAMETER_NAME_NOT_BLANK(406015, "Parameter name can not be blank.", "参数名称不能为空"),
    DOCKERFILE_NAME_DUPLICATE(406016, "Dockerfile name duplicate.", "Dockerfile名称已存在"),
    DOCKERFILE_CREATE_FAIL(406017, "Create Dockerfile failed.", "Dockerfile创建失败"),
    DOCKERFILE_NAME_NOT_BLANK(406018, "Dockerfile name can not be blank.", "Dockerfile名称不能为空"),
    PIPELINE_NAME_NOT_BLANK(406019, "Pipeline name can not be blank.", "流水线名称不能为空"),
    PIPELINE_NAME_DUPLICATE(406020, "Pipeline name duplicate.", "流水线名称已存在"),
    PIPELINE_CREATE_ERROR(406021, "Pipeline create failed.", "流水线创建失败"),
    PIPELINE_NAME_VALIDATE_ERROR(406022, "Pipeline name validate failed.", "流水线名称验证失败"),
    PIPELINE_NOT_EXIST(406023, "Pipeline not exist.", "流水线不存在"),
    PIPELINE_DELETE_ERROR(406024, "Pipeline delete failed.", "流水线删除失败"),
    PIPELINE_BUILD_ERROR(406025, "Pipeline build failed.", "流水线构建失败"),
    PIPELINE_DEPLOY_ERROR(406026, "Pipeline deploy failed.", "流水线部署失败"),
    SERVICE_NAME_NOT_BLANK(406027, "Service name can not be blank.", "服务名不能为空"),
    STAGE_BUILD_NOT_EXIST(406028, "Stage build not exist.", "构建记录不存在"),
    DEPLOY_IMAGE_NAME_ERROR(406029, "Deploy image error.", "部署镜像名错误"),
    STAGE_ADD_ERROR(406030, "Stage addPo error", "新增步骤失败"),
    STAGE_NOT_EXIST(406031, "Stage not exist.", "流水线步骤不存在"),
    TEST_SUITE_NOT_EXIST(406032, "Test suite not exist.", "测试套件不存在"),
    DOCKERFILE_USED_BY_PIPELINE(406033, "Dockerfile is used by pipeline, can not be deleted.", "DockerFile"
            + "被流水线使用中，无法删除"),
    STAGE_DELETE_ERROR(406034, "Stage delete error", "删除步骤失败"),
    STAGE_UPDATE_ERROR(406035, "Stage update error", "修改步骤失败"),
    SECRET_ADD_ERROR(406036, "Harbor secret addPo error", "harbor secret增加失败"),
    SECRET_UPDATE_ERROR(406037, "Harbor secret update error", "harbor secret更新失败"),
    DEPENDENCE_USED(406038, "Dependence is used by pipeline, can not be deleted.", "依赖被流水线使用中，无法删除"),
    STAGE_EMPTY(406038, "Pipeline has no stages, can not be built.", "流水线无步骤，无法执行"),
    DOCKERFILE_NOT_EXIST(406039, "Dockerfile not exist, please retry after refresh", "Dockerfile已被删除,请刷新后重试"),
    COPIED_PIPELINE_NOT_EXIST(4060040, "Copied pipeline not exist", "被复制的流水线不存在"),
    DEFAULT_BUILD_ENVIRONMENT_NOT_EXIST(4060041, "Default build environment not exist", "默认构建环境不存在"),
    PIPELINE_BUILD_STOP_ERROR(406042, "Pipeline build stop error.", "流水线停止失败"),
    PIPELINE_CONFIG_ERROR(406043, "Pipeline config error.", "流水线配置失败"),
    CREDENTIAL_SAVE_ERROR(406044, "Repository credential save error", "代码仓库用户名密码保存失败"),
    PIPELINE_ALREADY_DELETED(406045, "Pipeline already deleted", "流水线已被删除，请重新创建流水线"),
    ENVIRONMENT_ALREADY_DELETED(406046, "Build environment already deleted", "构建环境已被删除，请选择其他环境"),
    DEPENDENCE_ALREADY_DELETED(406047, "Dependence already deleted", "依赖已被删除，请选择其他依赖"),
    DOCKERFILE_ALREADY_DELETED(406048, "Dockerfile already deleted", "Dockerfile已被删除，请选择其他Dockerfile"),
    PIPELINE_RENAME_ERROR(406049, "Pipeline rename error", "流水线重命名失败"),
    PIPELINE_CREDENTIALS_USERNAME_NOT_NULL(406050, "Username can not be blank", "用户名不能为空"),
    DEPENDENCE_NO_PRIVILEGE_DELETE(406051, "Only System admin or create user can delete public dependence",
            "非系统管理员或创建者无法删除公有依赖"),
    ENVIRONMENT_NO_PRIVILEGE_DELETE(406052, "Only System admin or create user can delete public environment",
            "非系统管理员或创建者无法删除公有环境"),
    SERVICE_ALREADY_IN_BLUE_GREEN_UPGRADE(406053, "Service is already in blueGreen upgrade, please complete or "
            + "rollback the upgrade first", "Service is already in blueGreen upgrade, please complete or rollback the"
            + " upgrade first(服务正处于蓝绿升级中，请先完成或回滚升级)"),
    SERVICE_ALREADY_IN_CANARY_UPGRADE(406054, "Service is already in blueGreen upgrade, please complete or rollback "
            + "the upgrade first", "Service is already in canary upgrade, please complete or rollback the upgrade "
            + "first(服务正处于灰度升级中，请先完成或回滚升级)"),
    SERVICE_NOT_STARTED(406055, "Service is not started, cannot do canary upgrade",
            "Service is not started, cannot upgrade(服务未启动，无法升级)"),
    PIPELINE_CONFIG_UPDATE_ERROR_IN_JENKINS(406056, "Pipeline config update failed in Jenkins", "Jenkins流水线配置更新失败"),
    DEPLOY_IMAGE_NOT_EXIST(406057, "Deploy image not exist", "部署镜像不存在"),
    SYNC_STAGE_ERROR(406058, "Sync stage failed", "同步步骤信息失败"),
    JENKINS_PIPELINE_INFO_GET_ERROR(406059, "Jenkins pipeline info get failed", "获取Jenkins流水线信息失败"),
    PIPELINE_NOT_EXIST_IN_JENKINS(406060, "Pipeline not exist in Jenkins, please delete and recreate.",
            "流水线不存在于Jenkins中，请删除后重新创建"),
    PIPELINE_UPDATE_ERROR(406061, "Pipeline update failed.", "流水线信息更新失败"),
    SERVICE_ALREADY_IN_BLUE_GREEN_UPGRADE_INFORM(406062, "Service is already in blueGreen upgrade, please complete or"
            + " rollback the upgrade first", "服务正处于蓝绿升级中，请先完成或回滚升级"),
    TENANTNOTINTHRCLUSTER(951001, "The tenant is not in the current platform", "当前主机的租户不在本集群的库中，请切换其他集群的云管平台查看"),
    LOG_NULL(951002, "No log information", "没有日志信息"),
    NOT_REPEATE(951003, "Repetitive custom metrics", "重复的自定义指标"),
    INDICATOR(951004, "Set at least one indicator", "请至少设置一项伸缩指标"),
    PARAMETERS(951005, "Request parameters:", "请求参数:"),
    REDIS_CLUSTER_TYPE_UNKNOWN(951006, "Redis Cluster Status Unknown", "集群状态未知,请稍后再试"),
    REDIS_OPERATOR_BLANK(80000, "Redis operator is empty", "Redis operator为空"),
    REDIS_OPERATOR_IS_NOT_EXIST(80001, "Redis operator is not exist", "Redis operator不存在"),
    REDIS_OPERATOR_REPLICAS_ZERO(80002, "Redis operator replicas is 0", "Redis operator实例数为零"),
    REDIS_OPERATOR_IS_NOT_ASSIGNED_OPERATOR(80003, "Redis cluster is not assigned operator", "该Redis集群没有分配operator"),
    REDIS_CLUSTER_CONFIGMAP_NOT_FOUND(951007, "REDIS CLUSTER CONFIG MAP NOT FOUND", "找不到当前REDIS集群所对应的CONFIG_MAP文件"),
    REDIS_CLUSTER_NOT_FOUND(951007, "REDIS CLUSTER NOT FOUND", "未找到REDIS集群"),
    ES_CLUSTER_NODE_RESTART_ERROR(951008, "ES cluster node restart fail", "es节点重启失败"),
    ES_CLUSTER_RESTART_ERROR(951009, "ES cluster restart fail", "es集群重启失败"),
    ES_CLUSTER_CREATE_FAILED(302013, "es cluster create failed ", "ES集群创建失败"),
    ES_CLUSTER_IS_CREATE(600019, "es cluster is create ", "ES集群正在创建中"),
    ES_CLUSTER_REBOOT_STATUS_UNKNOWN(302014, "es cluster reboot failed", "ES集群/节点重启失败"),
    ES_CLUSTER_UPDATE_STATUS_UNKNOWN(302015, "ES cluster update failed", "ES集群状态未知,升级扩容/缩容失败"),
    REDIS_CLUSTER_DATA_BACKUP_FAILED(302016, "redis cluster backup failed", "redis集群备份失败"),
    ROCKETMQ_CLUSTER_DELETE_FAILED(302018, "rocketmq cluster delete failed", "mq集群删除失败"),
    ROCKETMQ_CLUSTER_NOT_FOUND(302017, "rocketMq cluster not found ", "rocketmq集群不存在"),
    ROCKETMQ_CLUSTER_CAPACITY_FAILED(302019, "rocketmq cluster capacity failed", "rocketmq集群升级扩容失败"),
    ROCKETMQ_CLUSTER_CREATE_RUNNING(302020, " rocketmq cluster is createing", "'rocketmq集群正在创建中"),
    ROCKETMQ_CLUSTER_CREATE_FAILED(600022, " rocketmq cluster is failed", "'rocketmq集群创建失败"),
    ROCKETMQ_CLUSTER_DELETEING(302021, "rocketmq cluster is deleteing", "rocketmq正在删除当中"),
    ROCKETMQ_CLUSTER_UPDATE_RUNNING(302022, "rocketmq cluster is update", "rocketmq正在更新当中"),
    ROCKETMQ_CLUSTER_DATA_BACKUP_FAILED(302016, "mq cluster backup failed", "MQ集群备份失败"),
    ROCKETMQ_CLUSTER_STATE_ERROR(302034, "redis cluster state is error", "MQ集群状态异常"),
    ROCKETMQ_CLUSTER_BACKUP_JOB_NOT_FOUND(302025, "mq cluster backup logs not found ", "未找到mq备份记录"),
    ROCKETMQ_CLUSTER_BACKUP_RUNNING(600020, "mq cluster is backuping", "mq集群正在备份当中"),
    ROCKETMQ_CLUSTER_DATA_RECOVER_FAILED(600020, "redis cluster data recover failed", "mq集群数据恢复失败"),
    ROCKETMQ_CLUSTER_DATA_RECOVER_RUNNING(600020, "redis cluster data is recover", "mq集群数据正在恢复中"),
    ROCKETMQ_CLUSTER_DATA_RECOVER_NOT_FOUND(302027, "redis cluster data recover log not found", "未找到该mq集群的数据恢复记录"),
    ROCKETMQ_CLUSTER_POD_RECOVER_NOT_FOUND(302028, "mq cluster recover pod not found", "mq集群恢复节点不存在"),
    ROCKETMQ_CLUSTER_IS_EXISTS(600021, "rocketMq cluster is exist ", "rocketmq集群已存在"),
    ROCKETMQ_CLUSTER_IS_NOT_EXISTS(600022, "rocketMq cluster is not exist ", "rocketmq集群不存在"),
    REDIS_CLUSTER_BACKUP_RUNNING(302023, "redis cluster is backuping", "redis集群正在备份当中"),
    REDIS_CLUSTER_IS_NOT_READY(302024, "redis cluster is not ready ", "redis集群尚未正常工作,展示无法获取卡槽信息"),
    REDIS_CLUSTER_BACKUP_JOB_NOT_FOUND(302025, "redis cluster backup logs not found ", "未找到redis备份记录"),
    ROCKET_CLUSTER_BACKUP_JOB_NOT_FOUND(302025, "mq cluster backup logs not found ", "未找到mq备份记录"),
    REDIS_CLUSTER_DATA_RECOVER_SLOTS_NOT_CORRESPONDENCE(302026, "redis cluster slots not correspondence",
            "输入节点卡槽与目标节点卡槽不一致,请检查卡槽信息"),
    REDIS_CLUSTER_DATA_RECOVER_NOT_FOUND(302027, "redis cluster data recover log not found", "未找到该redis集群的数据恢复记录"),
    REDIS_CLUSTER_DATA_RECOVER_RUNNING(302028, "redis cluster data is recover", "redis集群数据正在恢复中"),
    REDIS_CLUSTER_DATA_RECOVER_FAILED(302029, "redis cluster data recover failed", "redis集群数据恢复失败"),
    REDIS_CLUSTER_RESTART_FAILED(302030, "redis cluster restart failed", "redis集群重启失败"),
    REDIS_CLUSTER_RESTARTING(302031, "redis cluster is restart", "redis集群正在重启中"),
    REDIS_CLUSTER_DATA_MIGRATION_FAILED(302032, "redis cluster data Migration failed", "redis集群数据迁移失败"),
    CONFIG_MAP_UPDATE_FAIL(302033, "config map update failed", "config Map 修改失败"),
    REDIS_CLUSTER_STATE_ERROR(302034, "redis cluster state is error", "redis集群状态异常"),
    REDIS_MASTER_SLAVE_RELATIONSHIP_ERROR(301997, "redis master-slave relationship error", "主从关系错误"),
    ES_CLUSTER_FAILED_ROLLBACK(302035, "es cluster create failed , roll back", "es集群初始化失败"),
    ES_KIBANA_CREATEING(302035, "es kibana create failed", "es kibana 正在创建中"),
    ES_CLUSTER_TYPE_ERROR(302036, "es cluster type error", "es集群状态异常,暂不支持下一步操作"),
    ES_CLUSTER_UPDATE_ROLLBACK(302037, "es cluster update failed , start rollback", "es集群扩容/缩容失败,正在进行回滚"),
    ES_CLUSTER_UPDATE_READINESS_FAILED(302038, "es cluster update readiness failed", "更改es集群健康检查策略失败"),
    ES_CLUSTER_UPDATE_FAILED_ROLLBACK(302039, "es cluster update failed , is rollback", "es集群更新失败,正在回滚当中"),
    ES_CLUSTER_UPDATE_FAILED_ROLLBACK_SUCCESS(302040, "es cluster update failed , rollback success", "es集群更新失败,回滚完成"),
    ES_CLUSTER_UPDATE_SCALE_FAILED(302041, "es cluster update failed ", "ES集群节点变更失败"),
    ES_CLUSTER_UPDATE_SCALE_UPDATING(302042, "es cluster node updating ", "ES集群正在变更节点中"),
    ES_CLUSTER_STATUS_ERROR(302043, "es cluster status is error ", "ES集群状态异常"),
    ES_CLUSTER_STATUS_PORTRAIT_FAILED(302044, "es cluster update portrait failed ", "ES集群资源更新失败"),
    ES_CLUSTER_STATUS_PORTRAIT_UPDATING(302045, "es cluster update portrait is now ", "ES集群正在进行资源更新"),
    ES_CLUSTER_STATUS_ROLLBACK_FAILED(302046, "es cluster update failed is rollback ", "ES集群回滚失败,请联系系统管理员"),
    ES_CLUSTER_STATUS_ROLLBACK_SUCCESS(302047, "es cluster update failed is rollback ", "ES集群更新失败,回滚成功"),
    ES_CLUSTER_SCALE_FAILED_NEED_ROLLBACK(302049, "es cluster scale update failed , need to rollback ", "ES集群横向更新失败,"
            + "需要进行回滚"),
    ES_CLUSTER_PORTRAIT_FAILED_NEED_ROLLBACK(302052, "es cluster PORTRAIT update failed , need to rollback ", "ES"
            + "集群纵向更新失败,需要进行回滚"),
    ES_CLUSTER_STATUS_HEALTH_NOT_NEED_ROLLBACK(302051, "es cluster status running , No rollback required", "集群状态正常,"
            + "无需进行回滚"),
    ES_CLUSTER_STATUS_DELETE_RUNNING(302048, "es cluster is delete ", "ES集群正在删除"),
    ES_CLUSTER_STATUS_DELETE_FAILED(302053, "es cluster is delete failed ", "ES集群删除失败"),
    ES_CLUSTER_STATUS_IS_EXISTS(302054, "es cluster is exists ", "当前集群已存在"),
    GET_ES_CLUSTER_EVENTS_FAILED(302055, "get es cluster events is failed", "获取当前ES集群events失败"),
    GET_ES_CLUSTER_POD_FAILED(302056, "get es cluster pod is failed", "获取当前ES集群pod失败"),
    GET_ES_CLUSTER_STATUS_FAILED(302057, "get es cluster status is failed", "获取当前ES集群状态失败"),
    ES_CLUSTER_REBOOT_FAILED(302058, "es cluster reboot failed", "es集群重启失败,请联系管理员");

    // 错误代码
    private final int value;
    private final String reasonEnPhrase;
    private final String reasonChPhrase;

    ErrorCodeMessage(int value, String reasonEnPhrase, String reasonChPhrase) {
        this.value = value;
        this.reasonEnPhrase = reasonEnPhrase;
        this.reasonChPhrase = reasonChPhrase;
    }

    public int value() {
        return this.value;
    }

    public String phrase() {
        return reasonChPhrase;
    }

    public String getReasonEnPhrase() {
        return reasonEnPhrase;
    }

    @Override
    public String toString() {
        return Integer.toString(this.value);
    }
}
